package cn.edu.wzut;

import cn.edu.wzut.StockDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class ApplicationStartupRunner {

    @Autowired
    private StockDataService stockDataService;

    @PostConstruct
    public void onStartup() {
        new Thread(() -> stockDataService.startFetchingData()).start();
    }
}
